//package com.example.controller;
//
//import org.springframework.core.io.ClassPathResource;
//import org.springframework.http.MediaType;
//import org.springframework.http.ResponseEntity;
//import org.springframework.stereotype.Controller;
//import org.springframework.util.FileCopyUtils;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import java.io.IOException;
//import java.util.Arrays;
//
//@Controller
//public class OpenApiController {
//
//    @RequestMapping("/openapi.yaml")
//    public ResponseEntity<String> getOpenApiSpecAsYaml() throws IOException {
//        ClassPathResource resource = new ClassPathResource("openapi.yaml");
//        byte[] bytes = FileCopyUtils.copyToByteArray(resource.getInputStream());
//        return ResponseEntity.ok().contentType(MediaType.parseMediaType("application/x-yaml")).body(Arrays.toString(bytes));
//    }
//
//    @RequestMapping("/openapi.json")
//    public ResponseEntity<String> getOpenApiSpecAsJson() throws IOException {
//        ClassPathResource resource = new ClassPathResource("openapi.json");
//        byte[] bytes = FileCopyUtils.copyToByteArray(resource.getInputStream());
//        return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(Arrays.toString(bytes));
//    }
//}
